﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace App.Web.ViewModels
{    
    public class UserViewModel : BaseViewModel
    {
        public int ID { get; set; }

        [Required (ErrorMessage= "Please Enter an User Name")]
        [StringLength(150, ErrorMessage = "The {0} must be between {2} - {1} characters long.", MinimumLength = 6)]
        [Display(Name = "User Name")]
        public String UserName { get; set; }
        
        [Required(ErrorMessage = "Please Enter a Password")]
        [DataType(DataType.Password)]
        [Display(Name = "Password")]
        public String Password { get; set; }

        [Required(ErrorMessage = "Please Confirm Password")]
        [DataType(DataType.Password)]
        [Display(Name = "Confirm password")]
        [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
        public string ConfirmPassword { get; set; }

        [Required (ErrorMessage= "Please Select whether this User is Active?")]
        [Display(Name = "Is Active?")]
        public bool IsActive { get; set; }

        [Required(ErrorMessage = "Please Select an User Group")]
        [Display(Name = "Group")]
        public int GroupID { get; set; }
        
        //[Required (ErrorMessage="Please Select a Created Date")]
        //[DataType(DataType.DateTime)]
        //[Display(Name = "Created On")]
        //public String CreatedOn { get; set; }

        //[Required(ErrorMessage="Please Select a Modified Date")]
        //[Display(Name = "Modified On")]
        //[DataType(DataType.DateTime)]
        //public String ModifiedOn { get; set; }

        public GroupViewModel Group { get; set; }

        public CompanyViewModel Company { get; set; }
    }
}